Title Banner

Previous Book Contents Book Index Next

Inside Macintosh: QuickDraw GX Printing Extensions and Drivers /
Chapter 6 - Printing Resources / Printing Resources Reference
Resources Used Only in Printer Drivers


The Color Set ('crst') Resource

The color set ('crst') resource is used with raster imaging drivers to specify a set of replacement strings that are used when interpreting the information returned by a printer. This resource is optional.

Figure 6-26 shows the structure of a color set resource.

Figure 6-26 The color set resource

The color set resource consists of a number of color values that are defined for a certain color space.

Each color entry in the array consists of up to four integer values. What each value specifies depends on the type of color space, as described in the chapter "Colors and Color-Related Objects" in Inside Macintosh: QuickDraw GX Objects.

Listing 6-24 shows an example of a color set resource for the ImageWriter II printer driver. This printer uses the RGB color space and defines only 8 colors.

Listing 6-24 An example of a color set resource

resource gxColorSetResType (gxPrintingDriverBaseID, sysHeap,
                                                   purgeable)
{
   gxRGBSpace,
   {
      /* R     G     B     unused */
      0xFFFF,0xFFFF,0xFFFF,0x0000;  /* white */
      0xFFFF,0xFFFF,0x0000,0x0000;  /* yellow */
      0xFFFF,0x0000,0xFFFF,0x0000;  /* magenta */
      0xFFFF,0x0000,0x0000,0x0000;  /* red */
      0x0000,0xFFFF,0xFFFF,0x0000;  /* cyan */
      0x0000,0xFFFF,0x0000,0x0000;  /* green */
      0x0000,0x0000,0xFFFF,0x0000;  /* blue */
      0xFFFF,0xFFFF,0xFFFF,0x0000;  /* white */
      0x0000,0x0000,0x0000,0x0000;  /* black */
   };
};.

Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996




Navigation graphic, see text links

Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help